//
//  LGCommodityInfoCell.m
//  LuxuryGoods
//
//  Created by 刘星辰 on 2018/5/24.
//  Copyright © 2018年 Future. All rights reserved.
//

#import "LGCommodityInfoCell.h"


@implementation LGCommodityInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    UILabel * label =  [[UILabel alloc] init];
    label.font = FONT(10);
    label.textColor = [UIColor whiteColor];
    label.textAlignment = NSTextAlignmentCenter;
    label.numberOfLines = 0;
    label.backgroundColor = UIColorFromRGB(0xD5D5D5);
    [self.contentView addSubview:label];
    self.countLab = label;
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_offset(UIEdgeInsetsMake(0, 0, 0, 0));
    }];
    
    self.photo.contentMode = UIViewContentModeScaleAspectFill;
    self.photo.clipsToBounds = YES;
}

- (void)setPhotoCount:(NSInteger )count
{
    self.countLab.text = [NSString stringWithFormat:@"+\n（%lu/12）",count];
}

- (void)isChooseUI:(BOOL)yep
{
    self.countLab.hidden = !yep;
    
    self.photo.hidden = yep;
    self.deleteBtn.hidden = yep;
}

- (IBAction)deleteAction:(id)sender
{
    if (self.deleteAciton)
    {
        self.deleteAciton(self);
    }
}

@end
